class _Loading {
  private _state = 0

  public get state() {
    return this._state > 0
  }

  public set state(val: boolean) {
    if (val) {
      this._state += 1
    }
    else {
      this._state -= 1
    }
  }
}

export const Loading = reactive(new _Loading())
